package ltd.hxya.novel.book.controller;


import ltd.hxya.novel.book.service.IBookRankService;
import ltd.hxya.novel.book.vo.BookRankVo;
import ltd.hxya.novel.book.vo.BookVo;
import ltd.hxya.novel.common.bean.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hxya
 * @since 2022-09-18
 */
@RestController
@RequestMapping("/book/bookRank")
public class BookRankController {

    @Autowired
    private IBookRankService bookRankService;

    /**
     * 获取排行榜分类集合,查询出集合，并将集合添加到Redis中
     */
    @GetMapping("/listBookRank")
    public Result<List<BookRankVo>> listBookRank(){
        List<BookRankVo> bookRankVos = bookRankService.listBookRank();
        return Result.success(bookRankVos);
    }




}
